<template>
    <div>
        <el-col >
    <h5 style="text-align: center; background-color:rgb(103, 162, 239);margin: 0; font-size: 20px; padding: 20px 0; color: white;"><img src="../assets/ll.png" style="width:40px;height:40px" alt=""> OA管理系统</h5>
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
       background-color="rgb(103, 162, 239)"
       text-color="white"
      @close="handleClose"
      router>
      <el-submenu :index="index+'1'" v-for="(item,index) in ceb" :key="item.id">
        <template slot="title">
          <i class="el-icon-location"></i>
            
          <span>{{item.caidan}}</span>
        </template>
        <el-menu-item-group v-for="(item1,index1) in item.children" :key="index1">
          <el-menu-item :index="item1.path" style="color: white;">{{item1.caidan}}</el-menu-item>
        </el-menu-item-group>
       
      </el-submenu>
    
    
    </el-menu>
  </el-col>
    </div>
</template>
<script>
  import axios from 'axios'
export default {
  data() {
    return {
      ceb:[]
    }
  },
  mounted() {
    this.ce()
  },
    methods: {
      ce(){
      axios.get('/effect/user/side').then(res=>{
        this.ceb=res.data.side
      console.log(res)
      ;})
      },


        handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    },
}
</script>